﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace _70_536
{
    class IO
    {
        public string ChangeExtension(string path,string extension)
        {
            string value = string.Empty;
            value=Path.ChangeExtension(path, extension);
            if (File.Exists(value))
                File.Delete(value);
            File.Create(value);
            return value;
        }

        public List<string> DriveInfoX()
        {
            List<string> value = new List<string>();
            DriveInfo[] di = DriveInfo.GetDrives();
            foreach (DriveInfo drive in di)
            {
                if (drive.IsReady)
                {
                    value.Add("drive.Name " + drive.Name);
                    value.Add("drive.AvailableFreeSpace " + drive.AvailableFreeSpace.ToString());
                    value.Add("drive.DriveFormat "+drive.DriveFormat);
                    value.Add("drive.DriveType " + drive.DriveType.ToString());
                    value.Add("drive.IsReady " + drive.IsReady.ToString());
                    value.Add("drive.Name " + drive.Name);
                    value.Add("drive.RootDirectory " + drive.RootDirectory.ToString());
                    value.Add("drive.TotalFreeSpace " + drive.TotalFreeSpace.ToString());
                    value.Add("drive.TotalSize " + drive.TotalSize.ToString());
                    value.Add("drive.VolumeLabel " + drive.VolumeLabel);
                    value.Add("--");
                }
                else
                {
                    value.Add("drive.Name " + drive.Name);
                    //value.Add(drive.AvailableFreeSpace.ToString());
                    //value.Add(drive.DriveFormat);
                    value.Add("drive.DriveType " + drive.DriveType.ToString());
                    value.Add("drive.IsReady " + drive.IsReady.ToString());
                    value.Add("drive.Name " + drive.Name);
                    value.Add("drive.RootDirectory " + drive.RootDirectory.ToString());
                    //value.Add(drive.TotalFreeSpace.ToString());
                    //value.Add(drive.TotalSize.ToString());
                    //value.Add(drive.VolumeLabel);
                    value.Add("--");
                }
            }

            return value;
        }
        /*
        public string DirInfo()
        {
                    

        }
        */ 
    }
}
